# == Schema Information
# Schema version: 22
#
# Table name: cycles
#
#  id           :integer(11)   not null, primary key
#  name         :string(255)   
#  description  :text          
#  start_on     :date          
#  close_on     :date          
#  notify_on    :date          
#  form_id      :string(255)   
#  active       :boolean(1)    default(TRUE)
#  seeker_form  :text          
#  manager_view :text          
#  judge_view   :text          
#  admin_view   :text          
#

class Cycle < ActiveRecord::Base
  belongs_to :form     
  has_many :submissions, :dependent => :destroy 
  validates_presence_of :name, :start_on, :close_on, :notify_on, :form, 
    :seeker_form, :manager_view, :judge_view, :admin_view, :budget_amount                                                    
  validates_numericality_of :budget_amount
  
  def self.find_active
    Cycle.find(:all) 
  end
  
end
